import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/demand_research/education_survey_list_entity.dart';

EducationSurveyListEntity $EducationSurveyListEntityFromJson(Map<String, dynamic> json) {
  final EducationSurveyListEntity educationSurveyListEntity = EducationSurveyListEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    educationSurveyListEntity.id = id;
  }
  final String? launchDepartmentName = jsonConvert.convert<String>(json['launchDepartmentName']);
  if (launchDepartmentName != null) {
    educationSurveyListEntity.launchDepartmentName = launchDepartmentName;
  }
  final String? surveyName = jsonConvert.convert<String>(json['surveyName']);
  if (surveyName != null) {
    educationSurveyListEntity.surveyName = surveyName;
  }
  final String? surveyStartDate = jsonConvert.convert<String>(json['surveyStartDate']);
  if (surveyStartDate != null) {
    educationSurveyListEntity.surveyStartDate = surveyStartDate;
  }
  final int? surveyStatus = jsonConvert.convert<int>(json['surveyStatus']);
  if (surveyStatus != null) {
    educationSurveyListEntity.surveyStatus = surveyStatus;
  }
  final int? isMy = jsonConvert.convert<int>(json['isMy']);
  if (isMy != null) {
    educationSurveyListEntity.isMy = isMy;
  }
  final int? surveyType = jsonConvert.convert<int>(json['surveyType']);
  if (surveyType != null) {
    educationSurveyListEntity.surveyType = surveyType;
  }
  final String? surveyUserDepartmentNames = jsonConvert.convert<String>(json['surveyUserDepartmentNames']);
  if (surveyUserDepartmentNames != null) {
    educationSurveyListEntity.surveyUserDepartmentNames = surveyUserDepartmentNames;
  }
  return educationSurveyListEntity;
}

Map<String, dynamic> $EducationSurveyListEntityToJson(EducationSurveyListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['launchDepartmentName'] = entity.launchDepartmentName;
  data['surveyName'] = entity.surveyName;
  data['surveyStartDate'] = entity.surveyStartDate;
  data['surveyStatus'] = entity.surveyStatus;
  data['isMy'] = entity.isMy;
  data['surveyType'] = entity.surveyType;
  data['surveyUserDepartmentNames'] = entity.surveyUserDepartmentNames;
  return data;
}

extension EducationSurveyListEntityExtension on EducationSurveyListEntity {
  EducationSurveyListEntity copyWith({
    String? id,
    String? launchDepartmentName,
    String? surveyName,
    String? surveyStartDate,
    int? surveyStatus,
    int? isMy,
    int? surveyType,
    String? surveyUserDepartmentNames,
  }) {
    return EducationSurveyListEntity()
      ..id = id ?? this.id
      ..launchDepartmentName = launchDepartmentName ?? this.launchDepartmentName
      ..surveyName = surveyName ?? this.surveyName
      ..surveyStartDate = surveyStartDate ?? this.surveyStartDate
      ..surveyStatus = surveyStatus ?? this.surveyStatus
      ..isMy = isMy ?? this.isMy
      ..surveyType = surveyType ?? this.surveyType
      ..surveyUserDepartmentNames = surveyUserDepartmentNames ?? this.surveyUserDepartmentNames;
  }
}
